*{
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    /* 水平居中 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    margin: 0;
    background-color: #efedd6;
}

h1 {
    margin: 10px;
}

.box {
    /* 垂直居中 */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px;
    width: 400px;
    height: 200px;
    background-color: steelblue;
    color: #fff;
    border-radius: 10px;
    box-shadow: 2px 4px 5px rgba(0, 0, 0, .3);
    /* :奇数向右飞*/
    transform: translateX(400%);
    transition: transform .4s ease;
}

.box:nth-child(even) {
    /* 偶数向左飞 */
    transform: translateX(-400%);
}

.box.show {
    /* 关键点:倒着飞回原处 */
    transform: translateX(0);
}

.box h2 {
    font-size: 25px;
}

